package com.qingpeng.pay.adapter;

import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.qingpeng.pay.R;
import com.qingpeng.pay.beans.TeamBean;
import com.qingpeng.pay.utils.APP;

public class TeamListAdapter extends BaseQuickAdapter<TeamBean.DataProductBean.AgentlistProductBean, BaseViewHolder> {
    public TeamListAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(BaseViewHolder helper, TeamBean.DataProductBean.AgentlistProductBean item) {
        if (APP.userInfo.getShenfen().equals("1")){
            helper.setText(R.id.text_id,item.getUser_id())
                    .setText(R.id.text_name,item.getAccount())
                    .setText(R.id.text_reta,+(item.getRate()*1000)/10+"%")
                    .addOnClickListener(R.id.change_reta)
                    .addOnClickListener(R.id.text_fa);
        }else{
            helper.setText(R.id.text_id,item.getUser_id())
                    .setText(R.id.text_name,item.getAccount())
                    .setText(R.id.text_reta,+(item.getRate()*1000)/10+"%")
                    .addOnClickListener(R.id.change_reta)
                    .addOnClickListener(R.id.text_fa);
            helper.getView(R.id.text_fa).setVisibility(View.GONE);
        }
    }
}
